package com.liu.File;


import org.junit.Test;

import java.io.File;
import java.io.IOException;

/**
 * 文件的创建
 */
public class FileCreate {
    public static void main(String[] args) {

    }
    @Test
   public void create(){
       String parentFile = "d:\\";
       String fileName = "news1.txt";
       File file = new File(parentFile, fileName);
       try {
           file.createNewFile();
           System.out.println("文件创建成功");
       } catch (IOException e) {
           throw new RuntimeException(e);
       }
   }

}
